import { AxiosPromise } from 'axios'
import request from './request'

/**获取工单统计数量 */
export function getHomeOrderQty() {
  return request({
    url: '/home/getHomeOrderQty',
    method: 'get',
  })
}

/**
 * 获取首页统计数据
 * @returns {AxiosPromise} - promise
 */
export function getHomeOrderData(): AxiosPromise<HomeAPIResponse.StatisticsQty> {
  return request({
    url: '/home/getHomeOrderData',
    method: 'get',
  })
}

/**
 * 获取工单状态统计数量
 * @returns {AxiosPromise} - promise
 */
export function getHomeOrderStatusQty(): AxiosPromise<HomeAPIResponse.OrderStatusQty> {
  return request({
    url: '/home/getHomeOrderStatusQty',
    method: 'get',
  })
}

/**
 * 获取服务类型统计数量
 * @returns {AxiosPromise} - promise
 */
export function getHomeServiceTypeQty(): AxiosPromise<HomeAPIResponse.ServiceTypeQty> {
  return request({
    url: '/home/getModuleTypeQty',
    method: 'get',
  })
}

/**
 * 获取首页公告数据
 * @returns {AxiosPromise} - promise
 */
 export function getNoticeList(data) {
  return request({
    url: '/sys/notice/getList',
    method: 'post',
    data
  })
}